#define _CRT_SECURE_NO_WARNINGS 1

#include"Heap.h"

void test()
{
	Heap hp;
	HeapInit(&hp);
	HeapPush(&hp, 1);
	HeapPush(&hp, 2);
	HeapPush(&hp, 3);
	HeapPush(&hp, 4);
	HeapDestroy(&hp);
}

void test1()
{
	int arr[] = { 1,2,3,4,5,10,9,8,7,6 }, len = 0, i = 0;
	len = sizeof(arr) / sizeof(arr[0]);
	Heap hp;
	HeapInit(&hp);
	for (i = 0; i < len; i++)
	{
		HeapPush(&hp, arr[i]);
	}
	i = 0;
	while (!HeapEmpty(&hp))
	{
		arr[i++] = HeapTop(&hp);
		HeapPop(&hp);
	}
	for (i = 0; i < len; i++)
	{
		printf("%d ", arr[i]);
	}
}
int main()
{
	//test();
	test1();
	return 0;
}